#include <stdio.h>
#include <stdlib.h>

/**
This program tells if the entered number is odd or even using 
bit-wise operator.
**/

int any_odd_one(unsigned x)
{
	return x&1;
}

int main()
{
	int num, isOdd;
	printf("\n----------------------- Odd or Not ------------------------\n");
	printf("\tI can tell you if a number is Even or Odd. \n\tTry me\n");
	printf("------------------------------------------------------------\n");
	printf("\n\n************************\n");
	printf("Enter a number:");
	scanf("%d", &num);
	
	while (num!=000)
	{
		isOdd = any_odd_one(num);
		
		if(isOdd)
		{
			printf("%d is an odd number\n",num);
			printf("************************\n");
		}
		else
		{
			printf("%d is an even number\n",num);
			printf("************************\n");
		}
		
		printf("\n\nThats was great right? Try another number and I will tell you again.");
		printf("\n\n************************");
		printf("\nEnter a number:");
		scanf("%d",&num);
	}
	
	return 0;
}

